package com.fastloan.mgt.verify.model.bankcard;

import com.fastloan.mgt.verify.model.VerifyResult;

/**
 * @author yanwe
 * createTime 2017-12-2017/12/8 14:07
 */
public class BankCardVerifyResult extends VerifyResult{

    public static Integer EMPTY = 0;
    public static Integer ACCORD = 1;
    public static Integer FAIL = 2;
    public static Integer UNKNOW = 3;

    private Integer bankCardNoStatus;

    private Integer nameStatus;

    private Integer phoneStatus;

    public Integer getPhoneStatus() {
        return phoneStatus;
    }

    public void setPhoneStatus(Integer phoneStatus) {
        this.phoneStatus = phoneStatus;
    }

    public Integer getBankCardNoStatus() {
        return bankCardNoStatus;
    }

    public void setBankCardNoStatus(Integer bankCardNoStatus) {
        this.bankCardNoStatus = bankCardNoStatus;
    }

    public Integer getNameStatus() {
        return nameStatus;
    }

    public void setNameStatus(Integer nameStatus) {
        this.nameStatus = nameStatus;
    }

    public boolean allAccord() {
        return bankCardNoStatus != null && nameStatus != null && phoneStatus != null
                && bankCardNoStatus.equals(ACCORD) && nameStatus.equals(ACCORD) && phoneStatus.equals(ACCORD);
    }

    public static final class BankCardVerifyResultBuilder {
        private int ret;
        private String msg;
        private Integer bankCardNoStatus;
        private Integer nameStatus;
        private Integer phoneStatus;

        private BankCardVerifyResultBuilder() {
        }

        public static BankCardVerifyResultBuilder aBankCardVerifyResult() {
            return new BankCardVerifyResultBuilder();
        }

        public BankCardVerifyResultBuilder withRet(int ret) {
            this.ret = ret;
            return this;
        }

        public BankCardVerifyResultBuilder withMsg(String msg) {
            this.msg = msg;
            return this;
        }

        public BankCardVerifyResultBuilder withBankCardNoStatus(Integer bankCardNoStatus) {
            this.bankCardNoStatus = bankCardNoStatus;
            return this;
        }

        public BankCardVerifyResultBuilder withNameStatus(Integer nameStatus) {
            this.nameStatus = nameStatus;
            return this;
        }

        public BankCardVerifyResultBuilder withPhoneStatus(Integer phoneStatus) {
            this.phoneStatus = phoneStatus;
            return this;
        }

        public BankCardVerifyResult build() {
            BankCardVerifyResult bankCardVerifyResult = new BankCardVerifyResult();
            bankCardVerifyResult.setRet(ret);
            bankCardVerifyResult.setMsg(msg);
            bankCardVerifyResult.setBankCardNoStatus(bankCardNoStatus);
            bankCardVerifyResult.setNameStatus(nameStatus);
            bankCardVerifyResult.setPhoneStatus(phoneStatus);
            return bankCardVerifyResult;
        }
    }
}
